/*
 * Controller.h
 *
 *  Created on: Oct 23, 2012
 *      Author: nam20485
 */

#ifndef CONTROLLER_H_
#define CONTROLLER_H_

class Controller {
public:
	enum BUTTON
	{
		A		= 1 << 0,
		B		= 1 << 1,
		UP		= 1 << 2,
		DOWN	= 1 << 3,
		LEFT	= 1 << 4,
		RIGHT	= 1 << 5,
		SELECT	= 1 << 6,
		START	= 1 << 7,
	};

	Controller();
	virtual ~Controller();

	virtual bool getButtonState(BUTTON button) const = 0;
	virtual const int getButtonState() const = 0;

	inline bool buttonIsSet(BUTTON b, const int state) const	{ return (state & b); }

protected:
	virtual void initialize()		{ /* let descendants implement */ }

};

#endif /* CONTROLLER_H_ */
